package com.example.cofeed.adapter;

import android.widget.ImageView;

import com.bumptech.glide.Glide;
import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.example.cofeed.R;
import com.example.cofeed.api.APIUrl;
import com.example.cofeed.entity.MessageNotification;

public class MessageNotificationAdapter extends BaseQuickAdapter<MessageNotification, BaseViewHolder> {
    public MessageNotificationAdapter() {
        super(R.layout.adapter_message_notification);
    }

    @Override
    protected void convert(BaseViewHolder helper, MessageNotification item) {
        Glide.with(mContext).load(item.icon).into((ImageView) helper.itemView.findViewById(R.id.iv_image));
        helper.setText(R.id.tv_title, item.title);
        helper.setText(R.id.tv_date, item.time);
        if (item.num > 0){
            helper.setText(R.id.tv_num, item.num + "");
            helper.setGone(R.id.tv_num, true);
        }else {
            helper.setGone(R.id.tv_num, false);

        }

    }
}
